package com.ims.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

/**
 * @Author: zhangkun
 * @Date: 2022/8/26 11:27
 */
@TableName(value = "table_user")     // 指定表名
public class User implements Serializable {

    // value 与数据库主键列名一致，若实体类属性名与表主键列名一致可省略 value
    @TableId(value = "user_id", type = IdType.AUTO)
    private Integer userId; //用户id

    // 若没有开启驼峰命名，或者表中列名不符合驼峰规则，可通过该注解
    @TableField(value = "username")
    private String username; //用户名

    @TableField(value = "password")
    private String password; //密码，加密存储

    @TableField(value = "phone")
    private String phone; //手机号

    @TableField(value = "email")
    private String email; //邮箱

    @TableField(value = "create_by")
    private String createBy; //创建者

    @TableField(value = "create_time")
    private String createTime; //创建时间

    @TableField(value = "update_by")
    private String updateBy; //修改者

    @TableField(value = "update_time")
    private String updateTime; //修改时间

    @TableField(value = "login_time")
    private String loginTime; //登录时间

    @TableField(value = "logout_time")
    private String logoutTime; //登出时间

    @TableField(value = "sex")
    private String sex; //性别（1男，0女）

    @TableField(value = "status")
    private String status; //使用状态（1正常 0非正常）

    // 目前用户与角色是多对一关系，之后会升级至多对多关系
    @TableField(exist = false)
    private Integer roleId;

    @TableField(exist = false)
    private String roleName;

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(String loginTime) {
        this.loginTime = loginTime;
    }

    public String getLogoutTime() {
        return logoutTime;
    }

    public void setLogoutTime(String logoutTime) {
        this.logoutTime = logoutTime;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", phone='" + phone + '\'' +
                ", email='" + email + '\'' +
                ", createBy='" + createBy + '\'' +
                ", createTime='" + createTime + '\'' +
                ", updateBy='" + updateBy + '\'' +
                ", updateTime='" + updateTime + '\'' +
                ", loginTime='" + loginTime + '\'' +
                ", logoutTime='" + logoutTime + '\'' +
                ", sex='" + sex + '\'' +
                ", status='" + status + '\'' +
                ", roleId=" + roleId +
                ", roleName='" + roleName + '\'' +
                '}';
    }
}
